<?php

namespace common\models\personnel;

/**
等级管理表
 */
class Grade extends \common\models\base\BaseModel
{


    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%by_grade}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['grade','content'], 'required'],
            [[ 'id','status', 'created_at', 'updated_at'], 'integer'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'grade'=>'等级',
            'content'=>'详情',
            'status' => '状态',
            'created_at' => '创建时间',
            'updated_at' => '修改时间',
        ];
    }

    public function getCate()
    {
        return $this->hasOne(Personnel::class, ['grade_id' => 'id']);
    }
}
